let ResponseUtils = require("../utils/ResponseUtils");
let BookService = require("../service/book");
const {infoLogger, errorLogger} = require('../config').logger;
let CityService = require('../service/city');

class BookController {
    static async index(ctx) {
        // 接收客服端
        let req = ctx.request.body;
        ctx.body = {
            code: 200,
            msg: '创建文章成功1',
        }
    }

    static async getName(ctx) {
        //console.log(ctx);
        // 接收客服端
        infoLogger.info(">>>>>>获取用户名信息接口开始,请求参数",ctx.query);
        let req = ctx.query;
        let content=await BookService.getName(req);
        ctx.body = ResponseUtils.builder(content).success().build();
    }
    static async getBookInfoById(ctx){
        let id=ctx.params.id;
        let result=await BookService.getBookInfoById(id);
        ctx.body = ResponseUtils.builder(result).success().build();
    }
}
module.exports=BookController;
